package com.sisyphus.spinach.extension.form;

import android.content.Context;
import android.widget.Toast;

/**
 * 提示失败信息
 */
public class FailedInfo implements FormValidation.Callback {

    private final Context context;

    public FailedInfo(Context context) {
        this.context = context;
    }

    @Override
    public void call(boolean isSuccessful, CharSequence errorMessage) {
        if (!isSuccessful){
            Toast.makeText(context, errorMessage, Toast.LENGTH_SHORT).show();
        }
    }

}
